<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>10-继承关系-家业</title>
	</head>
	<body>
		<script type="text/javascript">
			/**
			 * 继承中,如果实例化子类输出一个方法,先看子类有没有这个方法,如果有就先执行子类的
			 */
			//学名:方法重载(父类和子类有相同的方法名)
			//超类-父类
			class Wangjlin{
				constructor(name) {
				    this.name = name;
				}
				money(){
					console.log('财产:',10000000);
				}
				work(){
					console.log('万达广场...');
				}
			}
			//子类-派生类
			class Wsicong extends Wangjlin{
				constructor(name) {
					super(name);
				    this.name = name;
				}
				work(){
					console.log('约么...');
				}
			}
			
			var ws = new Wsicong('王思聪');
			ws.money();
			ws.work();
		</script>
	</body>
</html>
